import type { MockMethod } from "vite-plugin-mock";
const serverContextPath = '/api/example-server'
const mock: Array<MockMethod> = [
	//设置租户资源树
	{
		url: serverContextPath + '/workflow/model/list',
		method: 'post',
		response: ({ body }) => {
			return {
				"code": 0,
				"message": "成功",
				"data": {
					"records": [
						{
							"id": "Process_1:2:9b03f9d6-be89-11ee-906d-00ff5669a489",
							"name": "第一个测试流程",
							"description": null,
							"key": "Process_1",
							"revision": 1,
							"version": 2,
							"category": "http://bpmn.io/schema/bpmn",
							"deploymentId": "9afb9564-be89-11ee-906d-00ff5669a489",
							"resourceName": "第一个测试流程.bpmn",
							"historyLevel": null,
							"startFormHandler": null,
							"diagramResourceName": null,
							"taskDefinitions": null,
							"hasStartFormKey": false,
							"suspensionState": 0,
							"tenantId": null,
							"versionTag": null,
							"historyTimeToLive": 180,
							"definitionIdentityLinkEntities": null,
							"candidateStarterUserIdExpressions": null,
							"candidateStarterGroupIdExpressions": null,
							"firstVersion": false,
							"graphicalNotationDefined": false,
							"identityLinksInitialized": false,
							"startableInTasklist": true,
							"subProcessScope": false
						},
						{
							"id": "Process_1:3:8f9bd04d-9fc9-11ee-9c81-00ff5669a489",
							"name": "1",
							"description": null,
							"key": "Process_1",
							"revision": 1,
							"version": 3,
							"category": "http://bpmn.io/schema/bpmn",
							"deploymentId": "8f761fdb-9fc9-11ee-9c81-00ff5669a489",
							"resourceName": "null.bpmn",
							"historyLevel": null,
							"startFormHandler": null,
							"diagramResourceName": null,
							"taskDefinitions": null,
							"hasStartFormKey": false,
							"suspensionState": 0,
							"tenantId": null,
							"versionTag": null,
							"historyTimeToLive": 180,
							"definitionIdentityLinkEntities": null,
							"candidateStarterUserIdExpressions": null,
							"candidateStarterGroupIdExpressions": null,
							"firstVersion": false,
							"graphicalNotationDefined": false,
							"identityLinksInitialized": false,
							"startableInTasklist": true,
							"subProcessScope": false
						}
					],
					"pageNumber": 1,
					"pageSize": 10,
					"totalPage": 1,
					"totalRow": 2
				}
			}
		}
	},
	//上传流程文件
	{
		url: serverContextPath + '/workflow/model/uploadModelFile',
		method: 'post',
		response: ({ body }) => {
			return {
				code: 0,
				message: '成功',
				data: '成功'
			}
		}
	},
	//根据ID删除流程设计数据
	{
		url: serverContextPath + encodeURIComponent('/workflow/model/delete/Process_1:2:9b03f9d6-be89-11ee-906d-00ff5669a489'),
		method: 'get',
		response: ({ body }) => {
			return {
				code: 0,
				message: '成功',
				data: '成功'
			}
		}
	},
	//发布流程
	{
		url: serverContextPath + encodeURIComponent('/workflow/model/deploy/Process_1:2:9b03f9d6-be89-11ee-906d-00ff5669a489'),
		method: 'get',
		response: ({ body }) => {
			return {
				code: 0,
				message: '成功',
				data: '成功'
			}
		}
	},
	//根据部署id获取流程定义
	{
		url: serverContextPath + '/workflow/model/getProcessDefinition/9afb9564-be89-11ee-906d-00ff5669a489',
		method: 'get',
		response: ({ body }) => {
			return {
				code: 0,
				message: '成功',
				data: '成功'
			}
		}
	},
	//根据id获取流程文件内容
	{
		url: serverContextPath + /^\/workflow\/model\/getResourceByDefId\/Process_1\:2\:9b03f9d6-be89-11ee-906d-00ff5669a489$/,
		method: 'get',
		response: ({ body }) => {
			return {
				"code": 0,
				"message": "成功",
				"data": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<bpmn:definitions xmlns:bpmn=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\" xmlns:camunda=\"http://camunda.org/schema/1.0/bpmn\" xmlns:dc=\"http://www.omg.org/spec/DD/20100524/DC\" xmlns:di=\"http://www.omg.org/spec/DD/20100524/DI\" expressionLanguage=\"http://www.w3.org/1999/XPath\" id=\"sample-diagram_1\" targetNamespace=\"http://bpmn.io/schema/bpmn\" typeLanguage=\"http://www.w3.org/2001/XMLSchema\">\r\n    \r\n  <bpmn:process camunda:historyTimeToLive=\"180\" id=\"Process_1\" isClosed=\"false\" isExecutable=\"true\" name=\"第一个测试流程\" processType=\"None\">\r\n        \r\n    <bpmn:startEvent id=\"Event_1bx3eme\" isInterrupting=\"true\" parallelMultiple=\"false\">\r\n            \r\n      <bpmn:outgoing>Flow_091pxri</bpmn:outgoing>\r\n          \r\n    </bpmn:startEvent>\r\n        \r\n    <bpmn:sequenceFlow id=\"Flow_091pxri\" sourceRef=\"Event_1bx3eme\" targetRef=\"Activity_1pmlkom\"/>\r\n        \r\n    <bpmn:sequenceFlow id=\"Flow_0hsucb7\" sourceRef=\"Activity_1pmlkom\" targetRef=\"Activity_07ecgww\"/>\r\n        \r\n    <bpmn:endEvent id=\"Event_02kndv2\">\r\n            \r\n      <bpmn:incoming>Flow_0ia7ree</bpmn:incoming>\r\n          \r\n    </bpmn:endEvent>\r\n        \r\n    <bpmn:sequenceFlow id=\"Flow_0ia7ree\" sourceRef=\"Activity_07ecgww\" targetRef=\"Event_02kndv2\"/>\r\n        \r\n    <bpmn:userTask camunda:assignee=\"1\" camunda:candidateGroups=\"2,3\" camunda:candidateUsers=\"3\" camunda:formKey=\"fr:246\" completionQuantity=\"1\" id=\"Activity_1pmlkom\" implementation=\"##unspecified\" isForCompensation=\"false\" name=\"第一个节点\" startQuantity=\"1\">\r\n            \r\n      <bpmn:incoming>Flow_091pxri</bpmn:incoming>\r\n            \r\n      <bpmn:outgoing>Flow_0hsucb7</bpmn:outgoing>\r\n          \r\n    </bpmn:userTask>\r\n        \r\n    <bpmn:userTask camunda:assignee=\"2\" camunda:candidateUsers=\"\" completionQuantity=\"1\" id=\"Activity_07ecgww\" implementation=\"##unspecified\" isForCompensation=\"false\" name=\"第二个节点\" startQuantity=\"1\">\r\n            \r\n      <bpmn:incoming>Flow_0hsucb7</bpmn:incoming>\r\n            \r\n      <bpmn:outgoing>Flow_0ia7ree</bpmn:outgoing>\r\n          \r\n    </bpmn:userTask>\r\n      \r\n  </bpmn:process>\r\n    \r\n  <bpmndi:BPMNDiagram id=\"BPMNDiagram_1\">\r\n        \r\n    <bpmndi:BPMNPlane bpmnElement=\"Process_1\" id=\"BPMNPlane_1\">\r\n            \r\n      <bpmndi:BPMNShape bpmnElement=\"Event_1bx3eme\" id=\"Event_1bx3eme_di\">\r\n                \r\n        <dc:Bounds height=\"36\" width=\"36\" x=\"202\" y=\"292\"/>\r\n              \r\n      </bpmndi:BPMNShape>\r\n            \r\n      <bpmndi:BPMNShape bpmnElement=\"Event_02kndv2\" id=\"Event_02kndv2_di\">\r\n                \r\n        <dc:Bounds height=\"36\" width=\"36\" x=\"612\" y=\"292\"/>\r\n              \r\n      </bpmndi:BPMNShape>\r\n            \r\n      <bpmndi:BPMNShape bpmnElement=\"Activity_1pmlkom\" id=\"Activity_0312xym_di\">\r\n                \r\n        <dc:Bounds height=\"80\" width=\"100\" x=\"290\" y=\"270\"/>\r\n              \r\n      </bpmndi:BPMNShape>\r\n            \r\n      <bpmndi:BPMNShape bpmnElement=\"Activity_07ecgww\" id=\"Activity_0qpy2pz_di\">\r\n                \r\n        <dc:Bounds height=\"80\" width=\"100\" x=\"450\" y=\"270\"/>\r\n              \r\n      </bpmndi:BPMNShape>\r\n            \r\n      <bpmndi:BPMNEdge bpmnElement=\"Flow_091pxri\" id=\"Flow_091pxri_di\">\r\n                \r\n        <di:waypoint x=\"238\" y=\"310\"/>\r\n                \r\n        <di:waypoint x=\"290\" y=\"310\"/>\r\n              \r\n      </bpmndi:BPMNEdge>\r\n            \r\n      <bpmndi:BPMNEdge bpmnElement=\"Flow_0hsucb7\" id=\"Flow_0hsucb7_di\">\r\n                \r\n        <di:waypoint x=\"390\" y=\"310\"/>\r\n                \r\n        <di:waypoint x=\"450\" y=\"310\"/>\r\n              \r\n      </bpmndi:BPMNEdge>\r\n            \r\n      <bpmndi:BPMNEdge bpmnElement=\"Flow_0ia7ree\" id=\"Flow_0ia7ree_di\">\r\n                \r\n        <di:waypoint x=\"550\" y=\"310\"/>\r\n                \r\n        <di:waypoint x=\"612\" y=\"310\"/>\r\n              \r\n      </bpmndi:BPMNEdge>\r\n          \r\n    </bpmndi:BPMNPlane>\r\n      \r\n  </bpmndi:BPMNDiagram>\r\n  \r\n</bpmn:definitions>\r\n"
			}
		}
	},
	//根据id获取流程文件内容
	{
		url: serverContextPath + encodeURIComponent('/workflow/model/getResourceByDefId/Process_1:3:8f9bd04d-9fc9-11ee-9c81-00ff5669a489'),
		method: 'get',
		response: ({ body }) => {
			return {
				"code": 0,
				"message": "成功",
				"data": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<bpmn:definitions xmlns:bpmn=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\" xmlns:camunda=\"http://camunda.org/schema/1.0/bpmn\" xmlns:dc=\"http://www.omg.org/spec/DD/20100524/DC\" xmlns:di=\"http://www.omg.org/spec/DD/20100524/DI\" expressionLanguage=\"http://www.w3.org/1999/XPath\" id=\"sample-diagram_1\" targetNamespace=\"http://bpmn.io/schema/bpmn\" typeLanguage=\"http://www.w3.org/2001/XMLSchema\">\r\n    \r\n  <bpmn:process camunda:historyTimeToLive=\"180\" id=\"Process_1\" isClosed=\"false\" isExecutable=\"true\" name=\"第一个测试流程\" processType=\"None\">\r\n        \r\n    <bpmn:startEvent id=\"Event_1bx3eme\" isInterrupting=\"true\" parallelMultiple=\"false\">\r\n            \r\n      <bpmn:outgoing>Flow_091pxri</bpmn:outgoing>\r\n          \r\n    </bpmn:startEvent>\r\n        \r\n    <bpmn:sequenceFlow id=\"Flow_091pxri\" sourceRef=\"Event_1bx3eme\" targetRef=\"Activity_1pmlkom\"/>\r\n        \r\n    <bpmn:sequenceFlow id=\"Flow_0hsucb7\" sourceRef=\"Activity_1pmlkom\" targetRef=\"Activity_07ecgww\"/>\r\n        \r\n    <bpmn:endEvent id=\"Event_02kndv2\">\r\n            \r\n      <bpmn:incoming>Flow_0ia7ree</bpmn:incoming>\r\n          \r\n    </bpmn:endEvent>\r\n        \r\n    <bpmn:sequenceFlow id=\"Flow_0ia7ree\" sourceRef=\"Activity_07ecgww\" targetRef=\"Event_02kndv2\"/>\r\n        \r\n    <bpmn:userTask camunda:assignee=\"1\" camunda:candidateGroups=\"2,3\" camunda:candidateUsers=\"3\" camunda:formKey=\"fr:246\" completionQuantity=\"1\" id=\"Activity_1pmlkom\" implementation=\"##unspecified\" isForCompensation=\"false\" name=\"第一个节点\" startQuantity=\"1\">\r\n            \r\n      <bpmn:incoming>Flow_091pxri</bpmn:incoming>\r\n            \r\n      <bpmn:outgoing>Flow_0hsucb7</bpmn:outgoing>\r\n          \r\n    </bpmn:userTask>\r\n        \r\n    <bpmn:userTask camunda:assignee=\"2\" camunda:candidateUsers=\"\" completionQuantity=\"1\" id=\"Activity_07ecgww\" implementation=\"##unspecified\" isForCompensation=\"false\" name=\"第二个节点\" startQuantity=\"1\">\r\n            \r\n      <bpmn:incoming>Flow_0hsucb7</bpmn:incoming>\r\n            \r\n      <bpmn:outgoing>Flow_0ia7ree</bpmn:outgoing>\r\n          \r\n    </bpmn:userTask>\r\n      \r\n  </bpmn:process>\r\n    \r\n  <bpmndi:BPMNDiagram id=\"BPMNDiagram_1\">\r\n        \r\n    <bpmndi:BPMNPlane bpmnElement=\"Process_1\" id=\"BPMNPlane_1\">\r\n            \r\n      <bpmndi:BPMNShape bpmnElement=\"Event_1bx3eme\" id=\"Event_1bx3eme_di\">\r\n                \r\n        <dc:Bounds height=\"36\" width=\"36\" x=\"202\" y=\"292\"/>\r\n              \r\n      </bpmndi:BPMNShape>\r\n            \r\n      <bpmndi:BPMNShape bpmnElement=\"Event_02kndv2\" id=\"Event_02kndv2_di\">\r\n                \r\n        <dc:Bounds height=\"36\" width=\"36\" x=\"612\" y=\"292\"/>\r\n              \r\n      </bpmndi:BPMNShape>\r\n            \r\n      <bpmndi:BPMNShape bpmnElement=\"Activity_1pmlkom\" id=\"Activity_0312xym_di\">\r\n                \r\n        <dc:Bounds height=\"80\" width=\"100\" x=\"290\" y=\"270\"/>\r\n              \r\n      </bpmndi:BPMNShape>\r\n            \r\n      <bpmndi:BPMNShape bpmnElement=\"Activity_07ecgww\" id=\"Activity_0qpy2pz_di\">\r\n                \r\n        <dc:Bounds height=\"80\" width=\"100\" x=\"450\" y=\"270\"/>\r\n              \r\n      </bpmndi:BPMNShape>\r\n            \r\n      <bpmndi:BPMNEdge bpmnElement=\"Flow_091pxri\" id=\"Flow_091pxri_di\">\r\n                \r\n        <di:waypoint x=\"238\" y=\"310\"/>\r\n                \r\n        <di:waypoint x=\"290\" y=\"310\"/>\r\n              \r\n      </bpmndi:BPMNEdge>\r\n            \r\n      <bpmndi:BPMNEdge bpmnElement=\"Flow_0hsucb7\" id=\"Flow_0hsucb7_di\">\r\n                \r\n        <di:waypoint x=\"390\" y=\"310\"/>\r\n                \r\n        <di:waypoint x=\"450\" y=\"310\"/>\r\n              \r\n      </bpmndi:BPMNEdge>\r\n            \r\n      <bpmndi:BPMNEdge bpmnElement=\"Flow_0ia7ree\" id=\"Flow_0ia7ree_di\">\r\n                \r\n        <di:waypoint x=\"550\" y=\"310\"/>\r\n                \r\n        <di:waypoint x=\"612\" y=\"310\"/>\r\n              \r\n      </bpmndi:BPMNEdge>\r\n          \r\n    </bpmndi:BPMNPlane>\r\n      \r\n  </bpmndi:BPMNDiagram>\r\n  \r\n</bpmn:definitions>\r\n"
			}
		}
	},
	//保存流程设计
	{
		url: serverContextPath + '/workflow/model/saveProcessDefinition',
		method: 'post',
		response: ({ body }) => {
			return {
				code: 0,
				message: '成功',
				data: '成功'
			}
		}
	}
]

export default mock